﻿window.onresize = function () {
    document.getElementById("main_right").style.height = document.body.clientHeight+200 + 'px';
    document.getElementById("main_right").style.width = document.body.clientWidth - 200 + 'px';
    document.getElementById("main_left").style.height = document.body.clientHeight+200 + 'px';
}



function loadBodySize() {
    document.getElementsByTagName('body')[0].style.height = window.screen.availHeight + 'px';

    document.getElementById("main_left").style.height = document.body.clientHeight+200 + 'px';
    document.getElementById("main_right").style.height = document.body.clientHeight+200 + 'px';
    document.getElementById("main_right").style.width = document.body.clientWidth - 200 + 'px';

    UserGrade();
}

function UserGrade()
{
    var arrayObj = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,17,18];
    var strGrade = document.getElementById("UserGrade").innerText;
    var arrGrade = strGrade.split(",");
    var f = 0;
    for (var i = 0; i < arrGrade.length; i++) {
        if (arrGrade[i] == "1" && arrGrade[i] != "")
        {
            for (var j = 0; j < arrayObj.length; j++) {
                var Div_Name = "left_Piece" + arrayObj[j];
                document.getElementById(Div_Name).style.display = "block";
            }
            f = 1;
            break;
        }
    }
    if (f == 0)
    {
        for (var i = 0; i < arrGrade.length; i++) {

            for (var j = 0; j < arrayObj.length; j++) {
                if (arrGrade[i] == arrayObj[j] && arrGrade[i]!="") {
                    var Div_Name = "left_Piece" + arrGrade[i];
                    document.getElementById(Div_Name).style.display = "block";
                }
            }

        }
    }
}


function mousemove(frm) {
    document.getElementById(frm).style.backgroundColor = "#777777";
}

function mouseout(frm) {
    document.getElementById(frm).style.backgroundColor = "#333333";
}


//安全退出超链接
function Out() {

    document.getElementById("UserAdmin").innerText = "";
    document.getElementById("UserGrade").innerText = "";
    document.getElementById("UserType").innerText = "";


    window.open("login.aspx", "_self");
}

function Div_Colse(frm) {
    for (var i = 2; i < 19; i++) {
        if (i != frm) {
            var openName = "Piece_open" + i;
            var ContentName = "Piece_Content" + i;

            document.getElementById(openName).innerText = "+";
            document.getElementById(ContentName).style.display = "none";
        }
    }
    document.getElementById("Div_mainShow").src = "";
}

//导航栏显示
function Div_Show(frm) {
    //去首页开始
    if (frm == "0") {
        window.open("../Index.aspx", "_black");
    }
    //去首页结束
    //使用指南
    if (frm == "1") {
        document.getElementById("Div_mainShow").src = "./Guidance.aspx";
    }
    //使用指南



    if (frm == "2") {
        if (Piece_open2.innerText == "+") {
            Piece_open2.innerText = "-";
            Piece_Content2.style.display = "block";
        }
        else {
            Piece_open2.innerText = "+";
            Piece_Content2.style.display = "none";
        }

        Div_Colse('2');
    }
    if (frm == "3") {
        if (Piece_open3.innerText == "+") {
            Piece_open3.innerText = "-";
            Piece_Content3.style.display = "block";
        }
        else {
            Piece_open3.innerText = "+";
            Piece_Content3.style.display = "none";
        }

        Div_Colse('3');
    }
    if (frm == "4") {
        if (Piece_open4.innerText == "+") {
            Piece_open4.innerText = "-";
            Piece_Content4.style.display = "block";
        }
        else {
            Piece_open4.innerText = "+";
            Piece_Content4.style.display = "none";
        }

        Div_Colse('4');
    }
    if (frm == "5") {
        if (Piece_open5.innerText == "+") {
            Piece_open5.innerText = "-";
            Piece_Content5.style.display = "block";
        }
        else {
            Piece_open5.innerText = "+";
            Piece_Content5.style.display = "none";
        }

        Div_Colse('5');
    }
    if (frm == "6") {
        if (Piece_open6.innerText == "+") {
            Piece_open6.innerText = "-";
            Piece_Content6.style.display = "block";
        }
        else {
            Piece_open6.innerText = "+";
            Piece_Content6.style.display = "none";
        }

        Div_Colse('6');
    }
    if (frm == "7") {
        if (Piece_open7.innerText == "+") {
            Piece_open7.innerText = "-";
            Piece_Content7.style.display = "block";
        }
        else {
            Piece_open7.innerText = "+";
            Piece_Content7.style.display = "none";
        }

        Div_Colse('7');
    }
    if (frm == "8") {
        if (Piece_open8.innerText == "+") {
            Piece_open8.innerText = "-";
            Piece_Content8.style.display = "block";
        }
        else {
            Piece_open8.innerText = "+";
            Piece_Content8.style.display = "none";
        }

        Div_Colse('8');
    }
    if (frm == "9") {
        if (Piece_open9.innerText == "+") {
            Piece_open9.innerText = "-";
            Piece_Content9.style.display = "block";
        }
        else {
            Piece_open9.innerText = "+";
            Piece_Content9.style.display = "none";
        }

        Div_Colse('9');
    }
    if (frm == "10") {
        if (Piece_open10.innerText == "+") {
            Piece_open10.innerText = "-";
            Piece_Content10.style.display = "block";
        }
        else {
            Piece_open10.innerText = "+";
            Piece_Content10.style.display = "none";
        }

        Div_Colse('10');
    }
    if (frm == "11") {
        if (Piece_open11.innerText == "+") {
            Piece_open11.innerText = "-";
            Piece_Content11.style.display = "block";
        }
        else {
            Piece_open11.innerText = "+";
            Piece_Content11.style.display = "none";
        }

        Div_Colse('11');
    }
    if (frm == "12") {
        if (Piece_open12.innerText == "+") {
            Piece_open12.innerText = "-";
            Piece_Content12.style.display = "block";
        }
        else {
            Piece_open12.innerText = "+";
            Piece_Content12.style.display = "none";
        }

        Div_Colse('12');
    }
    if (frm == "13") {
        if (Piece_open13.innerText == "+") {
            Piece_open13.innerText = "-";
            Piece_Content13.style.display = "block";
        }
        else {
            Piece_open13.innerText = "+";
            Piece_Content13.style.display = "none";
        }

        Div_Colse('13');
    }
    if (frm == "14") {
        if (Piece_open14.innerText == "+") {
            Piece_open14.innerText = "-";
            Piece_Content14.style.display = "block";
        }
        else {
            Piece_open14.innerText = "+";
            Piece_Content14.style.display = "none";
        }

        Div_Colse('14');
    }
    if (frm == "15") {
        if (Piece_open15.innerText == "+") {
            Piece_open15.innerText = "-";
            Piece_Content15.style.display = "block";
        }
        else {
            Piece_open15.innerText = "+";
            Piece_Content15.style.display = "none";
        }

        Div_Colse('15');
    }
    if (frm == "16") {
        if (Piece_open16.innerText == "+") {
            Piece_open16.innerText = "-";
            Piece_Content16.style.display = "block";
        }
        else {
            Piece_open16.innerText = "+";
            Piece_Content16.style.display = "none";
        }

        Div_Colse('16');
    }
    if (frm == "17") {
        if (Piece_open17.innerText == "+") {
            Piece_open17.innerText = "-";
            Piece_Content17.style.display = "block";
        }
        else {
            Piece_open17.innerText = "+";
            Piece_Content17.style.display = "none";
        }

        Div_Colse('17');
    }
    if (frm == "18") {
        if (Piece_open18.innerText == "+") {
            Piece_open18.innerText = "-";
            Piece_Content18.style.display = "block";
        }
        else {
            Piece_open18.innerText = "+";
            Piece_Content18.style.display = "none";
        }

        Div_Colse('18');
    }
}

function Div_Open(type, frm, web) {
    var UserType = document.getElementById("UserType").innerText;

    if (type == "1") {
        if (frm == "2" && web == "") {
            document.getElementById("Div_mainShow").src = 'DPD/DepartmentAdd.aspx';
        }
        if (frm == "2" && web != "")
        {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "3" && web == "") {
            document.getElementById("Div_mainShow").src = "Professional/ProfessionalAdd.aspx";
        }
        if (frm == "3" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "4" && web == "") {
            document.getElementById("Div_mainShow").src = "News/NewsAdd.aspx";
        }
        if (frm == "4" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "5" && web == "") {
            document.getElementById("Div_mainShow").src = "Teaching/TeachingAdd.aspx";
        }
        if (frm == "5" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "6" && web == "") {
            document.getElementById("Div_mainShow").src = "Student/StudentAdd.aspx";
        }
        if (frm == "6" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "7" && web == "") {
            document.getElementById("Div_mainShow").src = "admissions/AdmissionsAdd.aspx";
        }
        if (frm == "7" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "8" && web == "") {
            document.getElementById("Div_mainShow").src = "rules/RulesAdd.aspx";
        }
        if (frm == "8" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "9" && web == "") {
            document.getElementById("Div_mainShow").src = "Download/DownloadAdd.aspx";
        }
        if (frm == "9" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "10" && web == "") {
            document.getElementById("Div_mainShow").src = "Information/InformationAdd.aspx?Id=10";
        }
        if (frm == "10" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }

        if (frm == "11" && web == "") {
            document.getElementById("Div_mainShow").src = "Information/InformationAdd.aspx?Id=11";
        }
        if (frm == "11" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "12" && web == "") {
            document.getElementById("Div_mainShow").src = "Notice/NoticeAdd.aspx";
        }
        if (frm == "12" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "13" && web == "") {
            document.getElementById("Div_mainShow").src = "WeekCalendar/WeekAdd.aspx";
        }
        if (frm == "13" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "14" && web == "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "14" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "15" && web == "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "15" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "16" && web == "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "16" && web != "") {
            alert("该端口暂不提供服务！");
        }
        if (frm == "17" && web == "") {
            document.getElementById("Div_mainShow").src = "Service/ServiceAdd.aspx";
        }
        if (frm == "17" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "18" && web == "") {
            document.getElementById("Div_mainShow").src = "admin/adminadd.aspx";
        }
        if (frm == "18" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
    }

    if (type == "2") {
        if (frm == "2" && web == "") {
            document.getElementById("Div_mainShow").src = 'DPD/DepartmentAdmin.aspx';
        }
        if (frm == "2" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "3" && web == "") {
            document.getElementById("Div_mainShow").src = "Professional/ProfessionalAdmin.aspx";
        }
        if (frm == "3" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "4" && web == "") {
            document.getElementById("Div_mainShow").src = "News/NewsAdmin.aspx";
        }
        if (frm == "4" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "5" && web == "") {
            document.getElementById("Div_mainShow").src = "Teaching/TeachingAdmin.aspx";
        }
        if (frm == "5" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "6" && web == "") {
            document.getElementById("Div_mainShow").src = "Student/StudentAdmin.aspx";
        }
        if (frm == "6" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "7" && web == "") {
            document.getElementById("Div_mainShow").src = "admissions/AdmissionsAdmin.aspx";
        }
        if (frm == "7" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "8" && web == "") {
            document.getElementById("Div_mainShow").src = "rules/RulesAdmin.aspx";
        }
        if (frm == "8" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "9" && web == "") {
            document.getElementById("Div_mainShow").src = "Download/DownloadAdmin.aspx";
        }
        if (frm == "9" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "10" && web == "") {
            document.getElementById("Div_mainShow").src = "Information/InformationAdmin.aspx?Id=10";
        }
        if (frm == "10" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "11" && web == "") {
            document.getElementById("Div_mainShow").src = "Information/InformationAdmin.aspx?Id=11";
        }
        if (frm == "11" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "12" && web == "") {
            document.getElementById("Div_mainShow").src = "Notice/NoticeAdmin.aspx";
        }
        if (frm == "12" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "13" && web == "") {
            document.getElementById("Div_mainShow").src = "WeekCalendar/WeekAdmin.aspx";
        }
        if (frm == "13" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "14" && web == "") {
            document.getElementById("Div_mainShow").src = "Email/EmailShow.aspx";
        }
        if (frm == "14" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "15" && web == "") {
            document.getElementById("Div_mainShow").src = "navigation/navigation.aspx";
        }
        if (frm == "15" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "16" && web == "") {
            document.getElementById("Div_mainShow").src = "navigation/NavSub.aspx";
        }
        if (frm == "16" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "17" && web == "") {
            document.getElementById("Div_mainShow").src = "Service/ServiceAdmin.aspx";
        }
        if (frm == "17" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
        if (frm == "18" && web == "") {
            document.getElementById("Div_mainShow").src = "admin/adminAdmin.aspx";
        }
        if (frm == "18" && web != "") {
            alert("该端口暂不提供服务！");
            document.getElementById("Div_mainShow").src = "";
        }
    }

    if (type == "3") {
        if (UserType == "0")
        {
            if (frm == "2" && web == "") {
                document.getElementById("Div_mainShow").src = 'DPD/DepartmentUnpublished.aspx';
            }
            if (frm == "2" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "3" && web == "") {
                document.getElementById("Div_mainShow").src = "Professional/ProfessionalUnpublished.aspx";
            }
            if (frm == "3" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "4" && web == "") {
                document.getElementById("Div_mainShow").src = "News/NewsUnpublished.aspx";
            }
            if (frm == "4" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "5" && web == "") {
                document.getElementById("Div_mainShow").src = "Teaching/TeachingUnpublished.aspx";
            }
            if (frm == "5" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "6" && web == "") {
                document.getElementById("Div_mainShow").src = "Student/StudentUnpublished.aspx";
            }
            if (frm == "6" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "7" && web == "") {
                document.getElementById("Div_mainShow").src = "admissions/AdmissionsUnpublished.aspx";
            }
            if (frm == "7" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "8" && web == "") {
                document.getElementById("Div_mainShow").src = "rules/RulesUnpublished.aspx";
            }
            if (frm == "8" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "9" && web == "") {
                document.getElementById("Div_mainShow").src = "Download/DownloadUnpublished.aspx";
            }
            if (frm == "9" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "10" && web == "") {
                document.getElementById("Div_mainShow").src = "Information/InformationUnpublished.aspx?Id=10";
            }
            if (frm == "10" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "11" && web == "") {
                document.getElementById("Div_mainShow").src = "Information/InformationUnpublished.aspx?Id=11";
            }
            if (frm == "11" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "12" && web == "") {
                document.getElementById("Div_mainShow").src = "Notice/NoticeUnpublished.aspx";
            }
            if (frm == "12" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "13" && web == "") {
                document.getElementById("Div_mainShow").src = "WeekCalendar/WeekUnpublished.aspx";
            }
            if (frm == "13" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "14" && web == "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "14" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "15" && web == "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "15" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "16" && web == "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "16" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "17" && web == "") {
                document.getElementById("Div_mainShow").src = "Service/ServiceUnpublished.aspx";
            }
            if (frm == "17" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "18" && web == "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "18" && web != "") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
        }

        if(UserType=="1")
        {
            if (frm == "2") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "3") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "4") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "5") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "6") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "7") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "8") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "9") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "10") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "11") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "12") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "13") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "14") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "15") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "16") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "17") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
            if (frm == "18") {
                alert("该端口暂不提供服务！");
                document.getElementById("Div_mainShow").src = "";
            }
        }
        
    }

}